package com.eternal.widget.guqiang;

import androidx.databinding.BindingAdapter;

import com.eternal.framework.binding.command.BindingCommand;

/**
 * Created by Administrator
 * On 2020/4/29
 * Description:
 * @author Administrator
 */
public class ProgressToolbarAdapter {
    @BindingAdapter(value = {"title"})
    public static void setTitle(ProgressToolbar toolbar, String title){
        toolbar.setTitle(title);
    }

    @BindingAdapter(value = {"subtitle"})
    public static void setSubtitle(ProgressToolbar toolbar, String subtitle){
        toolbar.setSubtitle(subtitle);
    }

    @BindingAdapter(value = {"onBack"}, requireAll = false)
    public static void onBack(ProgressToolbar toolbar, BindingCommand<Void> command){
        com.eternal.framework.binding.viewadapter.view.ViewAdapter.
                onClickCommand(toolbar.getBack(), command, false);
    }

    @BindingAdapter(value = {"onNext"}, requireAll = false)
    public static void onNext(ProgressToolbar toolbar, BindingCommand<Void> command){
        com.eternal.framework.binding.viewadapter.view.ViewAdapter.
                onClickCommand(toolbar.getNext(), command, false);
    }

    @BindingAdapter(value = {"time"})
    public static void setTime(ProgressToolbar toolbar, String time){
        toolbar.setTime(time);
    }

    @BindingAdapter(value = {"timeColor"})
    public static void setTimeColor(ProgressToolbar toolbar, int color){
        toolbar.setTimeColor(color);
    }

    @BindingAdapter(value = {"percent"})
    public static void setProgress(ProgressToolbar toolbar, int percent){
        toolbar.setProgress(percent);
    }
}
